package cn.howxu.yichen_ovo.common.item;

import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @description: TODO
 * @author: HowXu
 * @date: 2025/9/22 09:00
 */
public class EGG extends Item {
    private int level;
    
    public EGG(int level) {
        super((new Item.Properties()).food((new FoodProperties.Builder()).nutrition(3*level).saturationMod(0.08F*level).build()).rarity(Rarity.RARE));
        this.level = level;
    }

    @Override
    public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) {
        super.appendHoverText(pStack, pLevel, pTooltipComponents, pIsAdvanced);
        pTooltipComponents.add(Component.translatable("tooltip.yichenovo,egg.level" + level).withStyle(ChatFormatting.GRAY));
    }

    public int getLevel() {
        return level;
    }
}
